# coding:utf-8
from odoo import models, fields, api, _
from odoo.exceptions import Warning
import odoo.addons.decimal_precision as dp


class StockMove(models.Model):
    _inherit = "stock.move"

    # qc_flag = fields.Boolean(string=u'是否质检', compute='_get_qc_flag', readonly=True, store=True)

    # @api.multi
    # def action_done(self):
    #     result = super(StockMove, self).action_done()
    #
    #     # Update delivered quantities on sale order lines
    #     sale_order_lines = self.filtered(lambda move: move.procurement_id.sale_line_id and move.product_id.expense_policy == 'no').mapped('procurement_id.sale_line_id')
    #     for line in sale_order_lines:
    #         line.qty_returned = line._get_qty_returned()
    #     return result

    qc_flag = fields.Boolean(string=u'是否质检', related='product_id.qc_flag', readonly=True, store=True)
    qc_str = fields.Html(u'需要质检')
